<?php

class ContentReader extends TTemplateControl
{
	public $name;
	public $content;
	
	public function onLoad()
	{	
		$manager = $this->Application->Modules['contents'];
		$this->content = $manager->getContentByName($this->getName());
		if($this->content)
			$this->content_text->Text = $this->content->getText();
	}
	
	public function setName($name)
	{
		$this->Page->setViewState('content_name', $name);
	}
	
	public function getName()
	{
		return $this->Page->getViewState('content_name', $this->Page->getPagePath());
	}
}

?>